package org.example.mybatisplus.tasks;

import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.util.Date;

@Component
public class MyScheduledTasks {
    @Scheduled(fixedRate = 5000)
    public void fixedRateJob() {
        System.out.println("Fixed Rate Job executed at: " + new Date());
    }

    @Scheduled(fixedDelay = 3000)
    public void fixedDelayJob() {
        System.out.println("Fixed Delay Job executed at: " + new Date());
    }

    @Scheduled(cron = "0/10 * * * * ?")
    public void cronJob() {
        System.out.println("Cron Job executed at: " + new Date());
    }
}